//
//  SettingViewController.m
//  AoJi
//
//  Created by Administrator on 15/1/20.
//  Copyright (c) 2015年 xuanheng. All rights reserved.
//

#import "SettingViewController.h"

@interface SettingViewController ()

@end

@implementation SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor=[UIColor whiteColor];
    
    
    UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom];
    back.frame=CGRectMake(20, 20, 44, 44);
    back.backgroundColor=[UIColor redColor];
    [back addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:back];
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(110, 30, 100, 30)];
    label.text=@"设置";
    label.textAlignment=NSTextAlignmentCenter;
    [self.view addSubview:label];
    
    UIButton *quit = [UIButton buttonWithType:UIButtonTypeCustom];
    quit.frame=CGRectMake(self.view.frame.size.width-64, 20, 44, 44);
    quit.backgroundColor=[UIColor redColor];
    [quit addTarget:self action:@selector(quit) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:quit];
    
    
    array = @[@"新消息通知",@"清除缓存",@"关于澳际",@"去AppStore评价"];
    UITableView *tableview = [[UITableView alloc]init];
    tableview.frame=CGRectMake(0, 150, self.view.frame.size.width, self.view.frame.size.height-150);
    tableview.dataSource=self;
    tableview.delegate=self;
    [self.view addSubview:tableview];
    
}

-(void)back
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

//退出登录
-(void)quit
{
    UIAlertView *quitAlertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"已经退出登录" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    [quitAlertView show];
}

#pragma mark tableview
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *indetifier=@"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indetifier];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:indetifier];
    }
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(20, 0, cell.contentView.frame.size.width-50, cell.contentView.frame.size.height)];
    label.text=array[indexPath.row];
    [cell.contentView addSubview:label];
    return cell;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
